import type { BaseTableConfig } from '@/components/base-ui/base-table/type';
import {
    widthLevel2,
    widthLevel3,
    thWordLength4,
    widthLevel1,
    thWordLength6,
    thWordLength5
} from '@/config';

export const tableConfig: BaseTableConfig = {
    items: [
        {
            modelKey: 'orderNumber',
            columnProps: {
                label: '订单号',
                width: widthLevel2
            }
        },
        {
            modelKey: 'itemCode',
            columnProps: {
                label: '物料编码',
                width: widthLevel2
            }
        },
        {
            modelKey: 'itemName',
            columnProps: {
                label: '物料名称',
                width: widthLevel2
            }
        },
        {
            modelKey: 'customerCode',
            columnProps: {
                label: '客户编码',
                width: widthLevel2
            }
        },
        {
            modelKey: 'customerCompanyName',
            columnProps: {
                label: '客户公司名称',
                width: widthLevel2
            }
        },
        {
            modelKey: 'orderDate',
            columnProps: {
                label: '下单日期',
                width: widthLevel3
            }
        },
        {
            modelKey: 'orderDeliveryDate',
            sortItem: true,
            sortUrlKey: 'order_delivery_date',
            columnProps: {
                label: '订单交期',
                width: widthLevel3 + 20
            }
        },
        {
            modelKey: 'orderQuantity',
            columnProps: {
                label: '产品数量',
                width: thWordLength4
            }
        },
        {
            modelKey: 'itemStock',
            columnProps: {
                label: '实际库存',
                width: thWordLength4
            }
        },
        {
            modelKey: 'plannedQuantity',
            columnProps: {
                label: '计划数量',
                width: thWordLength4
            }
        },
        {
            modelKey: 'schedulingStatus',
            slotName: 'schedulingStatus',
            columnProps: {
                label: '订单状态',
                width: thWordLength4
            }
        },
        {
            modelKey: 'plannedStartTime',
            columnProps: {
                label: '计划开始时间',
                width: widthLevel1
            }
        },
        {
            modelKey: 'plannedEndTime',
            columnProps: {
                label: '计划结束时间',
                width: widthLevel1
            }
        },
        {
            modelKey: 'deviationDays',
            slotName: 'deviationDays',
            columnProps: {
                label: '交期差异天数',
                width: thWordLength6
            }
        },
        {
            modelKey: 'orderProgress',
            columnProps: {
                label: '订单进度',
                width: thWordLength4
            }
        },
        {
            modelKey: 'orderPriority',
            slotName: 'orderPriority',
            sortUrlKey: 'order_priority',
            sortItem: true,
            columnProps: {
                label: '订单优先级',
                width: thWordLength5 + 60
            },
            otherConfig: {
                tip: true,
                tipMsg: '优先级越高，数字越小。'
            }
        },
        {
            modelKey: 'creator',
            columnProps: {
                label: '创建人',
                width: widthLevel2
            }
        },
        {
            modelKey: 'createTime',
            columnProps: {
                label: '创建时间',
                width: widthLevel1
            }
        }
    ],
    unSelection: true
};
